package work20241203_chap6oop.r_demo15;

/**
 * @author zdl
 * @date 2024/12/5
 */
public class SalariedEmployee extends Employee {
    private double salary;

    @Override
    public double getSalary(int month) {
        if (this.getMonth() == month) {
            return getSalary() + 100;
        }
        return salary;
    }

    public SalariedEmployee(double salary) {
        this.salary = salary;
    }

    public SalariedEmployee(String name, int month, double salary) {
        super(name, month);
        this.salary = salary;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }
}
